package com.xxxx
import org.springframework.beans.factory.annotation.Value
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.context.annotation.Bean
import org.springframework.data.hadoop.hbase.HbaseTemplate
import org.apache.hadoop.hbase.HBaseConfiguration



@SpringBootApplication
open class WebAppclation  {


    @Bean
    open fun hbaseTemplate(@Value("\${hbase.zookeeper.quorum}") quorum: String,
                           @Value("\${hbase.zookeeper.port}") port: String): HbaseTemplate {
        val hbaseTemplate = HbaseTemplate()
        val conf = HBaseConfiguration.create()
        conf.set("hbase.zookeeper.quorum", quorum)
        conf.set("hbase.zookeeper.port", port)
        hbaseTemplate.configuration = conf
        hbaseTemplate.setAutoFlush(true)
        return hbaseTemplate
    }

    companion object {
        @JvmStatic
        fun main(args: Array<String>) {
            SpringApplication.run(WebAppclation::class.java, *args)
        }
    }
}